package Test;

import java.util.ArrayList;

public class Demo13 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("111");
        list.add("222");
        list.add("111");
        list.add("333");
        int count=0;
        for (int i = 0; i < list.size(); i++) {
            String s = list.get(i);
            if("111".equals(s)){
                count++;
            }
        }
        System.out.println(count);

        System.out.println(list);
        list.add(1,"333");
        System.out.println(list);
        list.remove("333");
        System.out.println(list);
        String remove = list.remove(3);
        System.out.println(remove);
        System.out.println(list);
        String set = list.set(2, "333");
        System.out.println(set);
        System.out.println(list);



    }
}
